package com.example.demo.zabbix.request.builder.template;

import com.example.demo.zabbix.request.BaseRequest;
import com.example.demo.zabbix.request.builder.request.RequestBuilder;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * https://www.zabbix.com/documentation/4.0/manual/api/reference/templatescreen/copy
 */
public class TemplateScreenCopyRequestBuilder extends RequestBuilder<Map<String,List<String>>> {
    private List<String> screenIds;
    private List<String> templateIds;
    public TemplateScreenCopyRequestBuilder(String auth) {
        super("templatescreen.copy", auth);
        baseRequest.setParams(new HashMap<>());
    }

    public TemplateScreenCopyRequestBuilder(Long id, String auth) {
        super("templatescreen.copy", id, auth);
        baseRequest.setParams(new HashMap<>());
    }

    public List<String> getScreenIds() {
        return screenIds;
    }

    public TemplateScreenCopyRequestBuilder setScreenIds(List<String> screenIds) {
        this.screenIds = screenIds;
        return this;
    }

    public List<String> getTemplateIds() {
        return templateIds;
    }

    public TemplateScreenCopyRequestBuilder setTemplateIds(List<String> templateIds) {
        this.templateIds = templateIds;
        return this;
    }

    public TemplateScreenCopyRequestBuilder setParam(String key, List<String> value){
        baseRequest.getParams().put(key,value);
        return this;
    }

    public TemplateScreenCopyRequestBuilder setParams(Map<String,List<String>> params){
        baseRequest.getParams().putAll(params);
        return this;
    }

    @Override
    public BaseRequest<Map<String,List<String>>> builder() {
        baseRequest.getParams().put("screenIds",screenIds);
        baseRequest.getParams().put("templateIds",templateIds);
        return baseRequest;
    }
}
